<template>
    <div class="user-search-button" :size="size" :shape="shape" @click="onClick($event)">
        <svg-icon v-if="icon" :name="icon" />
        <span v-text="name"></span>
    </div>
</template>

<script>
export default {
    props: {
        size: { type: String, default: 'large' },
        shape: { type: String, default: 'plain' },
        name: { type: String, default: '' },
        icon: { type: String, default: '' },
    },
    data () {
        return {

        };
    },
    methods: {
        onClick (event) {
            this.$emit('click', event)
        }

    },
    created () {

    },

};
</script>

<style scoped lang="scss">
.user-search-button {
    height: 40px;
    box-sizing: border-box;
    font-size: 14px;
    font-family: Roboto-Medium, Roboto;
    font-weight: 500;
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ea4c89;
    border-radius: 8px;
    border: none;
    color: #fff;
    cursor: pointer;

    img,
    svg {
        width: 16px;
        height: 16px;
        margin-right: 4px;
    }

    &[size='medium'] {
        height: 36px;
    }

    // 实心的
    &[shape='solid'] {
        border-color: transparent;
        background: #ea4c89;
        color: #ffffff;

        &:hover {
            background: #c94175;
            color: #ffffff;
        }
    }

    // 空心
    &[shape='plain'] {
        border-color: transparent;
        background: #fff;
        border: 1px solid #e6e6e6;
        color: #000;

        &:hover {
            color: #c94175;
        }
    }

    // 文本
    &[shape='text'] {
        border: none;
        background: none;
        font-size: 14px;
        font-family: Roboto-Medium, Roboto;
        font-weight: 500;
        color: #212121;
        padding-left: 10px;
        padding-right: 10px;
        &:hover {
            background: #f0f0f0;
        }
    }
}
</style>
